﻿using BeetleX.XRPC.Clients;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using XRPC.Service;
using Zeus.Mvc.Controllers;

namespace XRPC.Client
{
    public class CompareController : ZeusController
    {
        static XRPCClient client;
        public CompareController()
        {
            if (client == null)
            {
                client = new XRPCClient("192.168.1.127", 9090, 2);
                client.Connect();
            }
        }

        [Route("compare/athena/performance")]
        [HttpPost]
        public async Task<string> AthenaPerformance()
        {
            var userService = client.Create<IUserService>();
            var result = (await userService.Login("admin", "123456"));
            return result.ToString();
        }
    }
}
